package com.note.simpleshop.module.coupon.dao;
import com.note.simpleshop.entity.TbCoupon;
import org.omg.PortableInterceptor.INACTIVE;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
public interface CouponRepository extends JpaRepository<TbCoupon, String> {
    List<TbCoupon> findByIsDeleteOrderByIdDesc(Integer isDelete);
    TbCoupon findByIdAndActiveAndIsDelete(String couponId,Integer active,Integer isDelete);
    /**
     * 获取频道优惠劵信息
     * @param isDelete
     * @param channel
     * @return
     */
    List<TbCoupon> findByChannelAndIsDeleteOrderByIdDesc(String channel,Integer isDelete);
}
